
local beenTo = {}
local save = achievements.GetValue( "Tourist", "list", "" )
if ( save != "" ) then
	beenTo = string.Explode( "\n", save )
end

local total = #beenTo
if ( total != 20 ) then
	timer.Simple( 0, function()
		local map = string.lower( ents.GetByIndex( 0 ):GetModel() )
		if ( total != 20 && !table.HasValue( beenTo, map ) ) then
			beenTo[ #beenTo + 1 ] = map
			achievements.SetValue( "Tourist", "list", table.concat( beenTo, "\n" ) )
			
			local total = math.Clamp( #beenTo, 0, 20 )
			achievements.Update( "Tourist", total / 20, total .. "/20" )
		end
	end )
end

achievements.Register( "Tourist", "Play a total of 20 different maps.", "achievements/tourist", total / 20, total .. "/20" )